package com.glsc.ngateway.platform.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class TopologicalGraphDto implements Serializable {
    private static final long serialVersionUID = 6682428566380565363L;

    //节点
    private List<TopologicalGraphNodeDto> nodes;

    //节点之间的联系
    private List<TopologicalGraphLinkDto> links;

    //分类列表
    private List<TopologicalGraphCategoryDto> categories;


}

/*

{
        "nodes": [
        {
        "id": "0",
        "name": "Myriel",
        "symbolSize": 19.12381,//圆面积大小，原则上是根据value值大小决定的。
        "x": -266.82776, //坐标位置。可以先省略
        "y": 299.6904,
        "value": 28.685715, //每个圆代表的值
        "category": 0 //类别。决定颜色，对应的下面categories数组索引
        },
        {
        "id": "1",
        "name": "Napoleon",
        "symbolSize": 2.6666666666666665,
        "x": -418.08344,
        "y": 446.8853,
        "value": 4,
        "category": 0
        },
        {
        "id": "2",
        "name": "MlleBaptistine",
        "symbolSize": 6.323809333333333,
        "x": -212.76357,
        "y": 245.29176,
        "value": 9.485714,
        "category": 1
        },
        {
        "id": "75",
        "name": "Brujon",
        "symbolSize": 13.638097333333334,
        "x": 238.79364,
        "y": -314.06345,
        "value": 20.457146,
        "category": 7
        },
        {
        "id": "76",
        "name": "MmeHucheloup",
        "symbolSize": 13.638097333333334,
        "x": 712.18353,
        "y": 4.8131495,
        "value": 20.457146,
        "category": 8
        }
        ],
        "links": [  //连线设置
        {
        "source": "1",  //指向node id
        "target": "0"
        },
        {
        "source": "2",
        "target": "0"
        },
        {
        "source": "3",
        "target": "0"
        },
        {
        "source": "3",
        "target": "2"
        }
        ],
        "categories": [  //类别。用于生成图例
        {
        "name": "A"
        },
        {
        "name": "B"
        },
        {
        "name": "C"
        },
        {
        "name": "D"
        },
        {
        "name": "E"
        },
        {
        "name": "F"
        },
        {
        "name": "G"
        },
        {
        "name": "H"
        },
        {
        "name": "I"
        }
        ]
        }*/
